package lschgcdev.gdx.input;

import lschgcdev.gdx.physic.GDXPickable;
import lschgcdev.tdgame.basic.Vector2i;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;

public class GDXInputManager implements InputProcessor{

	public GDXInputManager() {
		Gdx.input.setInputProcessor(this);
	}
	
	private void pickObjects(Vector2i v2i){
		for(GDXPickable pick : GDXPickable.gdxNodesPickable){
			pick.pickable(v2i);
		}
	}

	@Override
	public boolean keyDown(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean keyTyped(char arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean keyUp(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean mouseMoved(int arg0, int arg1) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean scrolled(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchDown(int arg0, int arg1, int arg2, int arg3) {
		pickObjects(new Vector2i(Gdx.input.getX(), Gdx.graphics.getHeight() - Gdx.input.getY()));
		return false;
	}

	@Override
	public boolean touchDragged(int arg0, int arg1, int arg2) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchUp(int arg0, int arg1, int arg2, int arg3) {
		// TODO Auto-generated method stub
		return false;
	}
}
